/*
 * @Author: linZeJian
 * @Date: 2022-09-02 16:18:35
 * @LastEditors: linZeJian
 * @LastEditTime: 2022-09-08 17:10:26
 * @Description: 
 */
import request from "@/utils/request.js";

export default {
  //获取部门
  async getDepartments(obj) {
    let res = await request.get(`api/departments`, {
      params: obj,
      baseURL: process.env.VUE_APP_USER_API,
    });
    return res;
  },
  //获取子应用
  async getSubApps(obj) {
    let res = await request.get(`api/subapps`, {
      params: obj,
      baseURL: process.env.VUE_APP_USER_API,
    });
    return res;
  },
  //获取人员
  async getUsers(obj) {
    let res = await request.get(`api/users`, {
      params: obj,
      baseURL: process.env.VUE_APP_USER_API,
    });
    return res;
  },

  // 获取部门列表
  async getDept(id) {
    let res = await request.get(`api/departments`, {
      params: {
        deptId: id,
        useBindPool: true
      },
      baseURL: process.env.VUE_APP_USER_API,
    });
    return res;
  },
  // 获取岗位列表
  async getPositions() {
    let res = await request.get(`api/positions`, {
      params: {
        useBindPool: true
      },
      baseURL: process.env.VUE_APP_USER_API,
    });
    return res;
  },
  // 通过部门获取人员信息
  async getDeptPers(id) {
    let res = await request.get(`api/users`, {
      params: {
        deptId: id,
        useBindPool: true
      },
      baseURL: process.env.VUE_APP_USER_API,
    });
    return res;
  },
  //获取当前登录
  async getLoginUserInfo() {
    let res = await request.get(`/api/me`, {
      params: {
        useBindPool: true
      },
      baseURL: process.env.VUE_APP_USER_API,
    });
    return res;
  },
};